import '@/assets/css/app.css';
import { createApp, h } from 'vue';
import App from '@/Components/Layout/Index.vue';
import { initPage } from '@/Utils';
import { useAntd } from '@/Plugins';

const modules = import.meta.glob('./Pages/**/*.vue');

window.app_init = async (elementId = '#app_page', data = '') => {
  const props = JSON.parse(data);
  const app = createApp({
    render: () => h(App, props)
  });
  await initPage(app, modules);
  await useAntd(app);
  app.mount(elementId);
};
